package com.ruoyi.teacher.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teacher.mapper.TPaperMapper;
import com.ruoyi.teacher.domain.TPaper;
import com.ruoyi.teacher.service.ITPaperService;

/**
 * 试卷Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-30
 */
@Service
public class TPaperServiceImpl implements ITPaperService 
{
    @Autowired
    private TPaperMapper tPaperMapper;

    /**
     * 查询试卷
     * 
     * @param id 试卷主键
     * @return 试卷
     */
    @Override
    public TPaper selectTPaperById(Long id)
    {
        return tPaperMapper.selectTPaperById(id);
    }

    /**
     * 查询试卷列表
     * 
     * @param tPaper 试卷
     * @return 试卷
     */
    @Override
    public List<TPaper> selectTPaperList(TPaper tPaper)
    {
        return tPaperMapper.selectTPaperList(tPaper);
    }

    /**
     * 新增试卷
     * 
     * @param tPaper 试卷
     * @return 结果
     */
    @Override
    public int insertTPaper(TPaper tPaper)
    {
        tPaper.setCreateTime(DateUtils.getNowDate());
        return tPaperMapper.insertTPaper(tPaper);
    }

    /**
     * 修改试卷
     * 
     * @param tPaper 试卷
     * @return 结果
     */
    @Override
    public int updateTPaper(TPaper tPaper)
    {
        tPaper.setUpdateTime(DateUtils.getNowDate());
        return tPaperMapper.updateTPaper(tPaper);
    }

    /**
     * 批量删除试卷
     * 
     * @param ids 需要删除的试卷主键
     * @return 结果
     */
    @Override
    public int deleteTPaperByIds(Long[] ids)
    {
        return tPaperMapper.deleteTPaperByIds(ids);
    }

    /**
     * 删除试卷信息
     * 
     * @param id 试卷主键
     * @return 结果
     */
    @Override
    public int deleteTPaperById(Long id)
    {
        return tPaperMapper.deleteTPaperById(id);
    }
}
